/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tables;

/**
 *
 * @author walkerp
 */
public class Range {

    public static class RangePair {
        private int min, max;
        public RangePair(int min, int max) {
            this.min = min;
            this.max = max;
        }
        public RangePair(int value) {
            this(value, value);
        }
        public boolean contains(int score) {
            return (score >= min && score <= max);
        }
    }
    
    private RangePair[] pairs;
        
    public Range(int[][] intpairs) {
        pairs = new RangePair[intpairs.length];
        for(int i = 0; i < intpairs.length; i++) {
            int[] p = intpairs[i];
            int min, max = min = p[0];
            if(p.length > 1)
                max = p[1];
            pairs[i] = new RangePair(min, max);
        }
    }
     
    
    public boolean contains(int score) {
        
        for(int i = 0; i < pairs.length; i++) {
           if(pairs[i].contains(score))
               return true;
        }
        return false;
    }
}
